﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpages/Main.master" EnableEventValidation="false"
    AutoEventWireup="true" CodeFile="VillageListCascade.aspx.cs" Inherits="User_Shares_VillageList1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../../Controls/ContentHolder/Holder1.ascx" TagName="Holder1" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
     <link href="../../Css/Master.css" rel="stylesheet" type="text/css" />
     
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">    
   
    <uc1:Holder1 ID="Holder11" runat="server" Title="لیست روستاها">
        <ContentTemplate>
            <asp:UpdatePanel ID="update1" UpdateMode="Always" runat="server">
                <ContentTemplate>
                    <table class="style1">
                        <tr>
                            <td>
                                <table dir="rtl">
                                    <tr>
                                        <td align="left" dir="rtl" width="100">
                                            <asp:Label ID="Label1" runat="server" Text="شهرستان:"></asp:Label>
                                        </td>
                                        <td align="right" dir="rtl" width="200">
                                            <asp:DropDownList ID="DropDownCity" runat="server" Width="150px" AutoPostBack="True"
                                                OnSelectedIndexChanged="DropDownCity_SelectedIndexChanged">
                                            </asp:DropDownList>
                                            <asp:CascadingDropDown ID="CascadingDropDownCity" runat="server" Category="City"
                                                LoadingText="لطفا کمی صبر کنید" PromptText="شهرستان را انتخاب نمایید" ServiceMethod="GetCity"
                                                ServicePath="~/user/shares/DatabaseLocations.asmx" TargetControlID="DropDownCity">
                                            </asp:CascadingDropDown>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" dir="rtl" width="100">
                                            <asp:Label ID="Label2" runat="server" Text="بخش:"></asp:Label>
                                        </td>
                                        <td align="right" dir="rtl" width="200">
                                            <asp:DropDownList ID="DropDownBakhsh" runat="server" Width="150px" AutoPostBack="True"
                                                OnSelectedIndexChanged="DropDownBakhsh_SelectedIndexChanged">
                                            </asp:DropDownList>
                                            <asp:CascadingDropDown ID="CascadingDropDownBakhsh" runat="server" Category="Bakhsh"
                                                LoadingText="لطفا کمی صبر کنید" ParentControlID="DropDownCity" PromptText="بخش را انتخاب نمایید"
                                                ServiceMethod="GetBakhsh" ServicePath="~/user/shares/DatabaseLocations.asmx"
                                                TargetControlID="DropDownBakhsh">
                                            </asp:CascadingDropDown>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" dir="rtl" width="100">
                                            <asp:Label ID="Label3" runat="server" Text="دهستان:"></asp:Label>
                                        </td>
                                        <td align="right" dir="rtl" width="200">
                                            <asp:DropDownList ID="DropDownDehestan" runat="server" Width="150px" AutoPostBack="True"
                                                OnSelectedIndexChanged="DropDownDehestan_SelectedIndexChanged">
                                            </asp:DropDownList>
                                            <asp:CascadingDropDown ID="CascadingDropDownDehestan" runat="server" Category="Dehestan"
                                                LoadingText="لطفا کمی صبر کنید" ParentControlID="DropDownBakhsh" PromptText="دهستان را انتخاب نمایید"
                                                ServiceMethod="GetDehestan" ServicePath="~/user/shares/DatabaseLocations.asmx"
                                                TargetControlID="DropDownDehestan">
                                            </asp:CascadingDropDown>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div id="printdiv">
                                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" EnableModelValidation="false"
                                        EnableViewState="true" CellPadding="4" CssClass="mainobject tablesorter" ForeColor="#333333"
                                        GridLines="None" OnRowDataBound="GridView1_RowDataBound" OnDataBound="GridView1_DataBound">
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                        <Columns>
                                             <asp:BoundField DataField="VillageCode" HeaderText="کد آبادی" ItemStyle-Width="100">
                                                <ItemStyle Width="100px" />
                                            </asp:BoundField>
                                            <asp:BoundField HeaderText="شهرستان" ItemStyle-Width="100" />
                                            <asp:BoundField HeaderText="بخش" ItemStyle-Width="100" />
                                            <asp:BoundField HeaderText="دهستان" ItemStyle-Width="100" />

                                            <asp:BoundField DataField="Name" HeaderText="نام روستا" ItemStyle-Width="100">
                                                <ItemStyle Width="100px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="Khanevar" HeaderText="تعداد خانوار" ItemStyle-Width="100">
                                                <ItemStyle Width="100px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="Population" HeaderText="جمعیت" ItemStyle-Width="100">
                                                <ItemStyle Width="100px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="ID" ItemStyle-Width="100">
                                                <HeaderStyle BackColor="White" />
                                                <ItemStyle Width="100px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="DehstanId" ItemStyle-Width="100">
                                                <HeaderStyle BackColor="White" />
                                                <ItemStyle Width="100px" />
                                            </asp:BoundField>
                                        </Columns>
                                        <EditRowStyle BackColor="#999999" />
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    </asp:GridView>
                                </div>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
            <input id="Button1" type="button" onclick="CallPrint('printdiv')" style="font-family: Tahoma;"
                value="پرینت" />
            <asp:Button ID="ExportToExcel0" runat="server" Text="ذخیره در فایل Excel" Font-Names="Tahoma"
                Height="25px" OnClick="ExportToExcel_Click" Width="150px" />
        </ContentTemplate>
    </uc1:Holder1>
    <script type="text/javascript">
        function CallPrint(strid) {
            var prtContent = document.getElementById(strid);
            var WinPrint = window.open('', '', 'letf=0,top=0,width=100%,height=100%,toolbar=0,scrollbars=2,status=0');
            WinPrint.document.write(prtContent.innerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
            //            prtContent.innerHTML = strOldOne;
        }
        jQuery(document).ready(function () {
            jQuery(".tablesorter").tablesorter();
        });
</script>
</asp:Content>
